# @Time     : 2025-04-11 11:19
# @Author  : Fioman
# @Phone    : 13149920693
#  @Motto   : Talk is cheap,show me the code ^_^
import requests

from FirstLesson import crawler_config

url = r"https://www.sogou.com/web?query=周杰伦"
requestHeaders = {
    "User-Agent":crawler_config.userAgent
}

resp = requests.get(url,headers=requestHeaders)

# 获取所有属性及其值
# for attr in dir(resp):
#     try:
#         print(f"{attr}: {getattr(resp, attr)}")
#     except Exception as e:
#         print(f"{attr}: 获取值时出错 - {e}")

# 获取其常用属性
print(resp.text) # 页面源代码,字符串形式
# print(resp.content) # 页面源代码,字节流形式
